<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
class Base extends Controller
{
    function _initialize()
    {
        parent::_initialize();
        $this->getCate();
        $this->getLogo();
        $this->getAd();
        $this->getSite();
    }
    function getCate()
    {
        $cate = Db::name('cate')->order('cate_id desc')->select();
        $this->assign('cate',$cate);
    }
    function getLogo()
    {
        //网站logo
        $logo = Db::name('logo')->select();
        $this->assign('logo',$logo);
    }
    function getAd()
    {
        //广告
        $ad = Db('ad')->select();
        $this->assign('ad',$ad);
    }
    function getSite()
    {
        $site = Db::name('site')->where(array('id'=>1))->find();
        $this->assign('site',$site);
    }
}